<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
        <title>{:C('SERVER_HOME_NAME')}</title>
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/login.css">
    </head>
    <body>
        <div class="login m50">
            <div class="login-box">
                <div class="login-img m40"><img src="__PUBLIC__/images/logo.png"></div>
                <form method="post" action="{:U('')}">
                    <div class="login-form"><input id="idInput" class="formIpt" type="text" name="username" placeholder="用户名"></div>
                    <div class="login-form"><input id="emailInput" class="formIpt" type="text" name="email" placeholder="邮箱"></div>
                    <div class="login-panel"><a href="{:U('Login/login')}" class="font-color fr">返回登录 </a></div>
                    <div class="login-btn"><a href="javascript:void(0);" class="btnlogin">找回密码</a></div>

                    <span style="font-size:12px;margin-top:20px;display:inline-block">点击将会发送找回密码的链接到你邮箱，通过该链接进入重置密码页面。</span>
                </form>
            </div>
        </div>
 	  <include file="Public/ok" />
        <script src="__PUBLIC__/js/jquery-1.7.min.js"></script>
        <script src="__PUBLIC__/js/page.js"></script>
        <script type="text/javascript">
            $(function () {
                $(".btnlogin").click(function () {  
                    if ($("#idInput").val() == "") {
                        prompting("账号不能为空", function () {
                            //TODO:提交
                        });
                        return false;
                    } else if ($("#emailInput").val() == "") {
                        prompting("邮箱不能为空", function () {
                            //TODO:提交
                        });
                        return false;
                    } else {
                       
                     var email =    $("#emailInput").val();
                     var username = $("#idInput").val();
                    
                        $.ajax({
                            type: 'POST',
                            url: "/User/backPassword_step1" ,
                            data: {username:username,email:email},
                            cache: false,
                            dataType: 'json',
                            success: function (data) {
                                  prompting(data.info);
                                if (data.status == 200) {
                                   setTimeout(function() {
						  location.reload();
					},3000);   
                                } 
                            },
                            error: function (err) {
                               
                                result = false;
                            }
                        },JSON);
                    }
                })

            })


        </script>


    </body>
</html>